package com.ks.core.tips;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
public class BaseBean<T extends Model> extends Model<BaseBean> {

    private static final long serialVersionUID = 1L;

    /**
     * 添加时间
     */
    @JSONField(serialize = false)
    @TableField("createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8")
    private Date createTime;
    /**
     * 修改时间
     */
    @JSONField(serialize = false)
    @TableField(value = "updateTime",fill = FieldFill.UPDATE)
    private Date updateTime;
    /**
     * 正常为0 删除为1
     */
    @JSONField(serialize = false)
    @TableField("delMark")
    private Integer delMark;

    @Override
    protected Serializable pkVal() {
        return null;
    }
}
